package cn.matrix42.potoo.format.markdown.element.text.list;

import java.util.ArrayList;
import java.util.List;

import cn.matrix42.potoo.format.markdown.element.MarkdownElement;

public class OrderedElement extends MarkdownElement {

    private final int no;
    private final String content;

    public OrderedElement(int no, String content) {
        this.no = no;
        this.content = content;
    }

    public int getNo() {
        return no;
    }

    public String getContent() {
        return content;
    }

    @Override
    public List<String> toMarkdownStringList() {
        List<String> list = new ArrayList<>();
        list.add(String.format("%d %s", no, content));
        return list;
    }

    public static OrderedElement of(int no, String content) {
        return new OrderedElement(no, content);
    }
}
